<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-bind(:简写)</title>
    <script src="node_modules/vue/dist/vue.js"></script>
    <style type="text/css">
        div {
            width: 100px;
            height: 100px;
            background-color: #fffbfb;
        }
        .red{
            background-color: red;
        }
        .blue{
            background-color: blue;
        }
    </style>
</head>
<body>
<div id="app">
    <!--src 或 height不想写死 想要对象中的值时-->
    <button @click="color=red">红色</button>
    <button @click="color=blue">蓝色</button>
    <div  :class="color">
        点击按钮改变背景颜色
    </div>
</div>

<script type="text/javascript">
    var app=new Vue({
        el:"#app",
        data:{
            color:"red",
        }
    });
</script>
</body>
</html>